<template>
  <div :class="{ app: true, top: !$route.meta.top }">
    <div v-if="!$route.meta.search">
      <van-nav-bar
        :fixed="true"
        :left-text="$route.meta.title || '音乐馆'"
        @click-left="onClickLeft"
      >
        <template #title>
          <div class="input">
            <van-search
              placeholder="搜索"
              :clearable="false"
              :autofocus="true"
              @click="goDetail('/home/search', '')"
            />
          </div>
        </template>
      </van-nav-bar>
    </div>
    <router-view></router-view>

    <van-tabbar v-model="active" v-if="!$route.meta.search">
      <van-tabbar-item class="iconfont icon-yinle" to="/home"
        >首页</van-tabbar-item
      >
      <van-tabbar-item class="iconfont icon-jiemuyugao" to="/find"
        >发现</van-tabbar-item
      >
      <van-tabbar-item class="iconfont icon-wode" to="/my"
        >我的</van-tabbar-item
      >
    </van-tabbar>
    <Ting
      v-if="!$route.meta.ting"
      :iconBofang1="true"
      :iconfont="iconfont"
    ></Ting>
  </div>
</template>
<script>
import Ting from './ting.vue'
export default {
  data() {
    return {
      active: 0,
      iconBofang1: true,
      iconfont: true
    }
  },
  methods: {
    onClickLeft() {
      this.$router.push('/home')
    }
  },
  components: {
    Ting
  }
}
</script>
<style lang="less">
.app {
  padding-bottom: 100px;
  .van-nav-bar__content {
    height: 54px;
  }
  .iconfont:before {
    font-size: 20px;
  }
  .icon-jiemuyugao:before {
    font-size: 26px;
  }
  .van-tabs__line {
    width: 60px;
    background-color: rgb(22, 241, 113);
  }
  .van-nav-bar__content {
    background-color: #f7f8fab6;
  }
  .van-icon {
    &::before {
      color: black;
    }
  }
  .van-nav-bar__text {
    font-size: 18px;
    font-weight: 700;
    font-family: "正楷";
    color: black;
  }
  .input {
    width: 300px;
    display: flex;
    justify-content: center;
    .van-search {
      background-color: #f7f8fab6;
      .van-search__content {
        background-color: white;
      }
    }
  }
  .van-card__title {
    font-size: 16px;
    font-weight: 600;
  }
  .iconfont {
    color: rgba(27, 27, 27, 0.548);
  }
  .van-tabbar-item--active {
    color: rgb(31, 216, 170);
  }
}
.top {
  padding-top: 54px;
}
</style>
